<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>转诊详情</title>
    <link rel="stylesheet" href="/yilianti/Public/home/js/layui/css/layui.css"/>
    <script src="/yilianti/Public/home/js/layui/layui.js"></script>
    <script src="/yilianti/Public/home/js/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script src="/yilianti/Public/home/js/zepto.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/yilianti/Public/home/js/TouchSlide.1.1.js"></script>
    <script src="/yilianti/Public/home/js/jQuery.textSlider.js"></script>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="/yilianti/Public/home/css/weui.css"/>
    <link rel="stylesheet" href="/yilianti/Public/home/css/myself.css"/>
    <script>
        layui.use('layer', function(){
            var layer = layui.layer;
        });
    </script>
</head>
<body>
<!--

-->


    <div class="page__bd">
        <div class="weui-form-preview__bd center_list_one xian_bottom xinxi_con">
            <div class="weui-form-preview__item">
                <label class="weui-form-preview__label">患者姓名：</label>
                <span class="weui-form-preview__value"><?php echo ($info['pname']); ?></span>
            </div>
            <div class="weui-form-preview__item">
                <label class="weui-form-preview__label">疾病类型：</label>
                <span class="weui-form-preview__value"><?php echo ($info['cate']); ?></span>
            </div>
            <div class="weui-form-preview__item">
                <label class="weui-form-preview__label">目标医院：</label>
                <span class="weui-form-preview__value"><?php echo ($info['hospital_now']); ?></span>
            </div>
            <div class="weui-form-preview__item">
                <label class="weui-form-preview__label">时间：</label>
                <span class="weui-form-preview__value"><?php echo ($info['addtime']); ?></span>
            </div>
            <div class="weui-form-preview__item">
                <label class="weui-form-preview__label">备注：</label>
                <span class="weui-form-preview__value"><?php echo ($info['remarks']); ?></span>
            </div>
            <div class="weui-form-preview__item">
                <label class="weui-form-preview__label">状态：</label>
                <span class="weui-form-preview__value">
                    <?php if($uid == $info['hospital_pre']): echo ($info['state1']); else: echo ($info['state2']); endif; ?>
                </span>
            </div>
            <div id="" class="chuo chuo_yizhuanzhen">333
                <?php if($uid == $info['hospital_pre']): echo ($info['state1']); ?>
                    <?php else: ?>
                    <?php echo ($info['state2']); endif; ?>
            </div>
        </div>
        <div class="page__bd">
            <div class="weui-gallery" id="gallery">
                <span class="weui-gallery__img" id="galleryImg"></span>
                <div class="weui-gallery__opr">
                    <a href="javascript:" class="weui-gallery__del">
                        <i class="weui-icon-delete weui-icon_gallery-delete"></i>
                    </a>
                </div>
            </div>
            <div class="weui-cells weui-cells_form">
                <div class="weui-cell">
                    <div class="weui-cell__bd">
                        <div class="weui-uploader">
                            <div class="weui-uploader__hd">
                                <p class="weui-uploader__title txt_cen ">病例信息</p>
                            </div>
                            <div class="weui-uploader__bd">
                                <?php if(is_array($pic)): if(is_array($pic)): foreach($pic as $key=>$list): ?><img src="/yilianti<?php echo ($list); ?>" height="100px" width="100px"><?php endforeach; endif; ?>
                                <?php else: ?>
                                    <img src="/yilianti<?php echo ($pic); ?>" height="100px" width="100px"><?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="weui-panel__bd ">
            <div class="weui-cell beizhu_kuang">
                <div class="weui-cell__hd"><label class="weui-label xinxi_label">病例备注：</label></div>
                <div class="weui-cell__bd ">
                    <p class="beiz">
                        <?php echo ($info['patient_remarks']); ?>
                    </p>
                </div>
            </div>
        </div>
        <?php if($uid != $info['hospital_pre']): if($info['state'] == 1): ?><div class="weui-cell beizhu_kuang">
                    <div class="weui-cell__hd"><label class="weui-label xinxi_label">转诊反馈：</label></div>
                    <div class="weui-cell__bd ">
                        <textarea class="weui-textarea" placeholder="请输入文本" rows="3" name="feedback" id="feedback"></textarea>
                    </div>
                </div>

                <div class="button-sp-area xiugai_but_area">
                    <a href="javascript:;" class="weui-btn weui-btn_mini weui-btn_default" id="no">拒绝</a>
                    <a href="javascript:;"  class="weui-btn weui-btn_mini weui-btn_primary" id="mod">接受</a>
                </div>
                <input type="hidden" id="id" name="id" value="<?php echo ($info['id']); ?>">
                <?php else: ?>
                <div class="weui-cell beizhu_kuang">
                    <div class="weui-cell__hd"><label class="weui-label xinxi_label">转诊反馈：</label></div>
                    <div class="weui-cell__bd ">
                        <p class="beiz">
                            <?php echo ($info['feedback']); ?>
                        </p>
                    </div>
                </div><?php endif; endif; ?>
    </div>
    <script type="text/javascript">
        $(function(){
            $("#mod").on('click',function(){
                var id = $('#id').val();
                var feedback = $('textarea[name=feedback]').val();
                $.ajax({
                    type:'post',
                    url:'/yilianti/index.php/User/state',
                    data:{id:id,feedback:feedback,state:3},
                    cache:false,
                    dataType:'json',
                    success:function(res){
                        if(res.code == 0){
                            layer.msg(res.msg,{time:2000},function () {
                                window.location.href = res.url;
                            });
                            return false;
                        }else{
                            layer.msg(res.msg);
                            return false;
                        }
                    }
                });
            });
            $("#no").on('click',function(){
                var id = $('#id').val();
                var feedback = $('textarea[name=feedback]').val();
                $.ajax({
                    type:'post',
                    url:'/yilianti/index.php/User/state',
                    data:{id:id,feedback:feedback,state:2},
                    cache:false,
                    dataType:'json',
                    success:function(res){
                        if(res.code == 0){
                            layer.msg(res.msg,{time:2000},function () {
                                window.location.href = res.url;
                            });
                            return false;
                        }else{
                            layer.msg(res.msg);
                            return false;
                        }
                    }
                });
            });
        });
        </script>



    <div class="weui-tabbar">
        <a href="/yilianti/index.php/Index/index" class="weui-tabbar__item weui-bar__item_on">
                <span style="display: inline-block;position: relative;">
                    <img src="/yilianti/Public/home/img/ind_01.png" alt="" class="weui-tabbar__icon">

                </span>
            <p class="weui-tabbar__label">首页</p>
        </a>
        <a href="/yilianti/index.php/Article/index" class="weui-tabbar__item">
            <img src="/yilianti/Public/home/img/ind_02.png" alt="" class="weui-tabbar__icon">
            <p class="weui-tabbar__label">新闻动态</p>
        </a>
        <a href="/yilianti/index.php/Referral/index" class="weui-tabbar__item">
                <span style="display: inline-block;position: relative;">
                    <img src="/yilianti/Public/home/img/ind_03.png" alt="" class="weui-tabbar__icon">

                </span>
            <p class="weui-tabbar__label">会诊转诊</p>
        </a>
        <a href="/yilianti/index.php/User/userlist" class="weui-tabbar__item">
            <img src="/yilianti/Public/home/img/ind_04.png" alt="" class="weui-tabbar__icon">
            <p class="weui-tabbar__label">个人中心</p>
        </a>
    </div>
    <script type="text/javascript">
        $(function(){
            $('.weui-tabbar__item').on('click', function () {
                $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');
            });
        });
    </script>



</body>
</html>